LIB_SUFFIX = .dll

# For Linux
# LIB_SUFFIX = .so
# For Mac
# LIB_SUFFIX = .dylib
AI_DIRS = $(filter-out ./ ./sdk/, $(sort $(dir $(wildcard ./*/))))
AI_LIBS = $(AI_DIRS:./%/=%$(LIB_SUFFIX))

CXX_FLAGS = g++ -fPIC -O2 --std=c++11 -I. -I./sdk -shared -o
# Replace "-O2" with "-g" to enable debug mode

all: $(AI_LIBS)

%$(LIB_SUFFIX): $(wildcard ./$(basename $@)/*.cpp) $(wildcard ./$(basename $@)/*.h) $(wildcard ./sdk/*.cpp) $(wildcard ./sdk/*.h)
	$(CXX_FLAGS) $@ $(wildcard ./$(basename $@)/*.cpp) $(wildcard ./sdk/*.cpp)
